package com.lagou.task18;

public class ProduceThread extends Thread {
    //确保消费者和生产者共用一个仓库，所以仓库对象从外部传入
    private StoreHouse storeHouse;
    public ProduceThread(StoreHouse storeHouse) {
        this.storeHouse = storeHouse;
    }

    @Override
    public void run() {
        while (true){
            storeHouse.product();
        }

    }


}
